package cn.mymall.web.controller.houtai.menu;



import cn.mymall.constant.ResultCodeConstant;
import cn.mymall.service.IUserMenuService;
import cn.mymall.support.ResultCode;
import cn.mymall.vo.menu.UserMenuReqVo;
import cn.mymall.web.controller.houtai.BaseHoutaiController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sky
 * @since 2021-03-11
 */
@RestController
@RequestMapping("/api/user/menu")
public class UserMenuController extends BaseHoutaiController {

    @Autowired
    private IUserMenuService userMenuService;

    @RequestMapping("/set")
    public ResultCode userMenuSet(UserMenuReqVo reqVo){
        if(reqVo == null || checkParamsIsBlank(reqVo.getUserId())){
            return ResultCode.getFailure(ResultCodeConstant.PARAMS_NOT_EXISTS.getCode(),ResultCodeConstant.PARAMS_NOT_EXISTS.getMessage());
        }
       return userMenuService.setUserMenu(reqVo);
    }
}
